<?php
class ResourceClass {
  private static $_not_support = 'method not implemented';
  public $remark = '';
  public $isActive = false;

  public function get(array $req, array $post, &$result) {return self::$_not_support;}
  public function post(array $req, array $post, &$result) {return self::$_not_support;}
  public function put(array $req, array $post, &$result) {return self::$_not_support;}
  public function delete(array $req, array $post, &$result) {return self::$_not_support;}
  public function options(array $req, array $post, &$result) {$result = get_class_methods(__CLASS__);return '';}

    public function autoCheck($user_id)
    {
        $rs = array('code' => 200, 'message' => '');
        $model = new \Orm\User\UserClass();
        try {
            $model->loadById($user_id);
        } catch (\Exception $e) {
            $rs['code'] = 201;
            $rs['message'] = '用户尚未授权';
        }
        return $rs;
    }
}
?>